<%--
  Created by IntelliJ IDEA.
  User: ZhuChunXiao
  Date: 2017/5/18
  Time: 16:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
  String _id=request.getParameter("_");
  request.setAttribute("now",new Date());
%>

<div class="row">
  <div class="col-lg-12">
    <div class="panel">
      <div class="panel-heading">
        <h3 class="panel-title">会议安排登记表</h3>
      </div>

      <div style="margin: 10px">

        <!-- Nav tabs -->
        <ul class="nav nav-tabs">
          <li class="active"><a id="other1" href="#bsc-tab-1" data-toggle="tab">基本信息</a></li>
          <c:if test="${personnelInfo.numStatus==1}">
            <li><a id="other2" href="#bsc-tab-2" data-toggle="tab">个人信息</a></li>
            <li><a id="other3" href="#bsc-tab-3" data-toggle="tab">用工信息</a></li>
            <li><a id="other4" href="#bsc-tab-4" data-toggle="tab">异动信息</a></li>
            <li><a id="other5" href="#bsc-tab-5" data-toggle="tab">资产信息</a></li>
            <li><a id="other6" href="#bsc-tab-6" data-toggle="tab">培训记录</a></li>
            <li><a id="other7" href="#bsc-tab-7" data-toggle="tab">奖惩记录</a></li>
          </c:if>
        </ul>

        <!-- Tabs Content -->
        <div class="tab-content">
          <input type="hidden" id="tableWidth" />

          <div class="tab-pane pad-btm fade in active" id="bsc-tab-1">
            <!-- BASIC FORM ELEMENTS -->
            <!--===================================================-->
            <form id="form_personnelinfo_input" class="panel-body form-horizontal form-padding">
              <input type="hidden" name="keyId" id="keyId" value="${personnelInfo.id}" />

              <div class="form-group" id="tempWidth">
                <label class="col-md-2 control-label">姓名<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-6">
                  <input type="text" id="name" name="name" class="form-control" value="${personnelInfo.name}" disabled>
                </div>
              </div>

              <div class="form-group">
                <label class="col-md-2 control-label">性别<i class="fa fa-asterisk txt-color-red"></i>
                </label>
                <div class="col-md-6">
                  <input type="text" id="sex" name="sex" class="form-control" value="${personnelInfo.sex==1?'男':'女'}" disabled>
                </div>
              </div>

              <div class="form-group">
                <label class="col-md-2 control-label">身份证号<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-6">
                  <input type="text" id="cardId" name="cardId" class="form-control" value="${personnelInfo.cardId}" disabled>
                </div>
              </div>

              <div class="form-group">
                <label class="col-md-2 control-label">部门<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-6">
                  <input type="text" id="deptName" name="deptName" class="form-control" value="${personnelInfo.department.name}" disabled>
                </div>
              </div>

              <div class="form-group">
                <label class="col-md-2 control-label">岗位<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-6">
                  <input type="text" id="postName" name="postName" class="form-control" value="${personnelInfo.post.name}" disabled>
                </div>
              </div>

              <div class="form-group">
                <label class="col-md-2 control-label">移动电话<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-6">
                  <input type="text" id="phone" name="phone" class="form-control" value="${personnelInfo.phone}" disabled>
                </div>
              </div>

              <div class="form-group">
                <label class="col-md-2 control-label">电子邮件<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-6">
                  <input type="text" id="email" name="email" class="form-control" value="${personnelInfo.email}" disabled>
                </div>
              </div>

              <div class="form-group">
                <label class="col-md-2 control-label">提交人</label>
                <div class="col-md-2">
                  <p class="form-control-static">${personnelInfo.creater.name}</p>
                </div>
                <label class="col-md-2 control-label">提交日期</label>
                <div class="col-md-2">
                  <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${personnelInfo.createTime}" /></p>
                </div>
              </div>
            </form>
            <!--===================================================-->
            <!-- END BASIC FORM ELEMENTS -->

            <div class="panel-footer">
              <a class="btn btn-default" id="apply-re-common" href="javascript:void(0)">
                <i class="fa fa-lg fa-mail-reply"></i> 返回视图
              </a>
              <c:if test="${personnelInfo.numStatus==0 && user.id==personnelInfo.creater.id}">
                <a class="btn btn-warning" key="ajax_personnelinfo_edit" href="javascript:void(0);"><i class="fa fa-lg fa-edit"></i> 编辑表单 </a>
              </c:if>
            </div>
          </div>


          <%--第二部分！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！！--%>
          <div class="tab-pane fade" id="bsc-tab-2"></div>
          <div class="tab-pane fade" id="bsc-tab-3"></div>
          <div class="tab-pane fade" id="bsc-tab-4"></div>
          <div class="tab-pane fade" id="bsc-tab-5"></div>
          <div class="tab-pane fade" id="bsc-tab-6"></div>
          <div class="tab-pane fade" id="bsc-tab-7"></div>
        </div>
      </div>

    </div>
  </div>
</div>

<script>
  $(function(){
    $("#tableWidth").val($("#tempWidth").width());
  });

  //个人信息
  $("#other2").click(function(){
    var selfId="${personnelInfo.personnelSelf.id}";
    if(selfId!=""&&selfId!=null){
      loadURL("<%=path%>/activiti/personnelself/read/"+selfId,$('#bsc-tab-2'));
    }else{
      loadURL("<%=path%>/activiti/personnelself/create?parentId="+$("#form_personnelinfo_input #keyId").val(),$('#bsc-tab-2'));
    }
  });

  //用工信息
  $("#other3").click(function(){
    var useId="${personnelInfo.personnelUse.id}";
    if(useId!=""&&useId!=null){
      loadURL("<%=path%>/activiti/personneluse/read/"+useId,$('#bsc-tab-3'));
    }else{
      loadURL("<%=path%>/activiti/personneluse/create?parentId="+$("#form_personnelinfo_input #keyId").val(),$('#bsc-tab-3'));
    }
  });

  //奖惩记录
  $("#other7").click(function(){
    var parentId=$("#form_personnelinfo_input #keyId").val();
    var tableWidth=$("#tableWidth").val();
    loadURL("<%=path%>/activiti/personnelreward/toList?parentId="+parentId+"&tableWidth="+tableWidth,$('#bsc-tab-7'));
  });




  //返回视图
  $("#apply-re-common").click(returnToHashUrl);

  //编辑
  $("a[key='ajax_personnelinfo_edit']").unbind("click").bind("click",function(){
    __confirm_dialog("提示：","确定要编辑基本信息吗？",
            function () {
              // 加载编辑页面
              loadURL("<%=path%>/activiti/personnelinfo/edit/"+$("#keyId").val(),$('#page-content'));
            }
    )
  });

</script>







